<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link th:href="@{css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{css/jquery.dataTables.css}" rel="stylesheet">
    <title>goods</title>
</head>

<body>

<!--<div id="toolbar" class="btn-group">-->
    <!--<button id="btn_add" type="button" class="btn btn-default" data-toggle="modal" data-target="#addModal">-->
        <!--<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增-->
    <!--</button>-->
    <!--<button id="btn_update" type="button" class="btn btn-default">-->
        <!--<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>编辑-->
    <!--</button>-->
    <!--<button id="btn_delete" type="button" class="btn btn-default" onclick="BtchDeleteBook()">-->
        <!--<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除-->
    <!--</button>-->
<!--</div>-->


<button type="button" onclick="location.href='newGoods'" class="btn btn-primary">新增</button>
<div>
    <div>
        <table id="goodsTable" class="table">
            <thead>
            <tr>
                <th>运单号</th>
                <th>发货人</th>
                <th>货物类别</th>
                <th>质量</th>
                <th>容积</th>
                <th>收货人</th>
                <th colspan="2" style="text-align: center">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="item : ${page.list}">
                <td th:text="${item.billno}"></td>
                <td th:text="${item.shipper}"></td>
                <td th:text="${item.type}"></td>
                <td th:text="${item.quality}"></td>
                <td th:text="${item.volume}"></td>
                <td th:text="${item.consignee}"></td>
                <td><a th:href="@{/newGoods(id=${item.id})}">edit</a></td>
                <td><a th:href="@{/delete(id=${item.id})}">delete</a></td>
            </tr>
            </tbody>
        </table>
    </div>
    <br/>
    <div style="float:right;margin-right: 50px">
        <a th:href="@{/goods(start=1)}">[首  页]</a>
        <a th:href="@{/goods(start=${page.pageNum-1})}">[上一页]</a>
        <a th:href="@{/goods(start=${page.pageNum+1})}">[下一页]</a>
        <a th:href="@{/goods(start=${page.pages})}">[末  页]</a>
    </div>
</div>

</body>

<!-- Mainly scripts -->
<script th:src="@{/js/jquery-3.4.1.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/js/jquery.dataTables.min.js}"></script>
<script>

    $(document).ready(function(){
        // var page={}
        // $.ajax({
        //     url:'goods',
        //     success:function(data){
        //         debugger
        //     }
        //
        // })
    });

</script>

</html>
